package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserDayPoint;
import com.culturalCenter.dataCenter.mapper.user.UserDayPointMapper;
import com.culturalCenter.dataCenter.service.user.UserDayPointService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserDayPoint业务层接口实现类
 * @Date
 *****/
@Service
public class UserDayPointServiceImpl implements UserDayPointService {

    @Resource
    private UserDayPointMapper userDayPointMapper;

    @Override
    public PageInfo<UserDayPoint> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userDayPointMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userDayPointMapper.deleteById(id);
    }

    @Override
    public Integer update(UserDayPoint userDayPoint) {
        return userDayPointMapper.update(userDayPoint);
    }

    @Override
    public Integer add(UserDayPoint userDayPoint) {
        return userDayPointMapper.insert(userDayPoint);
    }

    @Override
    public UserDayPoint findById(String id) {
        return userDayPointMapper.queryById(id);
    }

    @Override
    public List<UserDayPoint> findAll(UserDayPoint userDayPoint) {
        return (List<UserDayPoint>) userDayPointMapper.queryAll(userDayPoint);
    }

}
